<?php
namespace Common\Controller;

use Common\Controller\AppbaseController;



class AdminController extends AppbaseController
{

	//检查是否登录
	public function _initialize()
	{
		//检查是否有登录
		if ( !session('AdminId') ) {
		//获取控制器名称与方法名称
			if ( CONTROLLER_NAME != 'Login') {
				$this->redirect('Login/login');
			} 			
		} else {
			if ( CONTROLLER_NAME == 'Login') {
				$this->redirect('Index/index');
			} else {
				$this->redirect($_SERVER['PATH_INFO']);
			}
		}
	}









}
